home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / ptc.zip / PTC.DOC next >
Text File  |  1988-02-06  |  2KB  |  133 lines

  1.  
  2.  
  3.  
  4.                                                            PTC(1)
  5.  
  6.  
  7.  
  8. NAME
  9.      ptc - Pascal to C translator
  10.  
  11. SYNOPSIS
  12.      ptc < pascal source > c source
  13.  
  14. DESCRIPTION
  15.      _P_t_c reads a correct Pascal program and prints a C program
  16.      with the same behaviour.  It is intended as a tool for tran-
  17.      sporting finished applications to environments that lack
  18.      Pascal compilers, it is _n_o_t intended for program develop-
  19.      ment.
  20.  
  21.      The input should comply with the ISO level 0 Pascal defini-
  22.      tion.  Two common Pascal extensions are also recognized: the
  23.      keyword otherwise may be used for default entries in case-
  24.      statements, the keyword external may be used in place of the
  25.      forward directive to signify that a procedure or function is
  26.      defined in a library.  Furthermore, the translator does not
  27.      require a complete Pascal program, a consistent subset of
  28.      declarations can be translated.  Thus a primitive module
  29.      concept is supported.
  30.  
  31. SEE ALSO
  32.      Ptc implementation notes.
  33.  
  34. CAVEATS
  35.      The quality of an object program is of course highly depen-
  36.      dent on the C compiler that processes the translated code.
  37.      Arithmetic operations are sometimes implemented in a way
  38.      that is incompatible with the Pascal definition.  For exam-
  39.      ple, the translator assumes that:
  40.  
  41.           a := b mod c
  42.  
  43.      can be accurately translated into
  44.  
  45.           a = b % c
  46.  
  47.      but that may not be true if c is negative.  A check on the
  48.      characteristics of integer and float arithmetic is strongly
  49.      recommended.
  50.  
  51.      Some Pascal constructs are impossible to express in C.  The
  52.      translator will not object to:
  53.  
  54.           type ptr = ^ ptr;
  55.  
  56.      but a C-compiler may balk at the resulting:
  57.  
  58.           typedef   ptr * ptr;
  59.  
  60.  
  61.  
  62.  
  63.                                                                 1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. PTC(1)
  71.  
  72.  
  73.  
  74. BUGS
  75.      The program can't translate comments from Pascal to C.
  76.  
  77.      The translator does not do complete typechecking so a Pascal
  78.      program that isn't formally correct may cause malfunction.
  79.  
  80.      Passing a procedure as parameter to an enclosing recursive
  81.      procedure may produce erroneous code (see the implementation
  82.      notes).
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. 2
  130.  
  131.  
  132.  
  133.